#include "stdafx.h"
#include "LoverManager.h"

LoverManager::LoverManager()
{
}
LoverManager::~LoverManager()
{

}
Lover* LoverManager::Add(LoverId id)
{
	Lover* pLover = manager<Lover,LoverId>::Add(id);
	LOGGER_INFO("Add:%p,id:%d",pLover,id);
	return pLover;
}
bool LoverManager::Remove(LoverId id)
{
	if (id <= 0) return false;
	LOGGER_INFO("Remove,id:%d",id);
	return manager<Lover,LoverId>::Remove(id);
}
Lover* LoverManager::CreateFromLoverInfo(LoverInfo& info)
{
	Int32 nLoverId = GenerateIdInt32();
	Lover* pLover = Add(nLoverId);
	if (pLover == NULL)
	{
		LOGGER_ERROR("CreateFromLoverInfo,pLover == NULL,nLoverId:%d",nLoverId);
		return NULL;
	}
	pLover->SetLoverInfo(info);
	return pLover;
}